//
//  personDataView.m
//  QcMedical1
//
//  Created by ios001 on 2016/12/25.
//  Copyright © 2016年 jiawen Du. All rights reserved.
//

#import "PersonDataView.h"
#import "Users.h"

@interface PersonDataView ()
@property (weak, nonatomic) IBOutlet UIImageView *imgVI;

//@property (weak, nonatomic) IBOutlet UILabel *lb_name;
//
//@property (weak, nonatomic) IBOutlet UILabel *lb_idCard;
//
//@property (weak, nonatomic) IBOutlet UILabel *lb_phoneNum;

@property (nonatomic, strong) Users *currentUser;
@end

@implementation PersonDataView

+ (instancetype)personDataView{
    return [[[UINib nibWithNibName:@"PersonDataView" bundle:nil] instantiateWithOwner:nil options:nil] lastObject];
}


- (void)awakeFromNib{
    [super awakeFromNib];
    
//    self.lb_name.text = self.currentUser.true_name;
    NSString *cardID = self.currentUser.card_number;
    cardID = [cardID stringByReplacingCharactersInRange:NSMakeRange(14, 4) withString:@"****"];
 //   self.lb_idCard.text = cardID;
    
    NSString *phoneNum = self.currentUser.mobile_number;
    phoneNum = [phoneNum stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
  //  self.lb_phoneNum.text = phoneNum;
    
    [self.imgVI sd_setImageWithURL:[NSURL URLWithString:self.currentUser.head_photo] placeholderImage:[UIImage imageNamed:@"bbx6"]];
    self.imgVI.layer.cornerRadius = 45;
    self.imgVI.layer.masksToBounds = YES;
}


//解档
- (Users *)currentUser{
    if (!_currentUser) {
        //解档
        self.currentUser = [Users unarchiver];
    }
    return _currentUser;
}


@end
